Repository navigation
fix(print): a zh-CN record page prints dates in Chinese order, fits its line items to the sheet, and prints on white with plain values - #34422
Conversation
The 'short' date face follows the locale's date order; on a print page a data table fits the printable width, and the page prints on white with links and select badges as plain text. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pNoRjsgMJKr5utN33 Final head · area o1-E · 2026-11-16T17:01Z Head-sha: 98f2943 |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn 席位核对 · PR #34422 · L1-b · 2026-11-16T17:03ZHead-sha: L1 · REWORK(3 项,都不动代码:2 项只改正文,1 项补一次读数) · area o1-E 定稿评论 6923217613 所钉 head。merge-base 已核、无问题的部分
R1 · 正文与裁决 6922479414 不一致。 裁决 C 已于 16:32Z 记录,但正文仍有三处写着待决:
维护者读速读,会被要求再决定一件已经决定的事。请改成:item 3 已裁 C(6922479414),规则不动,由模板拆块解决;第 2–4 步(答复报告人、hotcrm 卡、docs/skills 各补一句的文字 PR)各自的去处,写卡号或写明由哪个 PR 承接。「需要你做的」改为「无」。 R2 · 席位条件 (b) 缺读数。 席位要求一个「先红后绿」的 zh 屏幕 pin。dev 报告写「Ablation: not run; the reverse direction is the before/after Chromium reading plus the red-first harness on main」,但正文和两份 dev 报告都没有新 zh pin 在 main 上为红的实测读数。Chromium 的 before/after 读的是 PDF,不是这个 pin。从代码推断它必红(main 上 R3 · 深色主题这条残留缺去处。 Acceptance notes 写:「The print stylesheet does not force black text. A dark-theme console would print light text on the new white page.」本 PR 把纸面强制成白底,所以在深色主题下打开「背景图形」打印,会从原来的深底浅字变成白底浅字。请二选一:给一张卡(#N),或写明一条可核对的理由说明它不是本 PR 带来的回退(例如浏览器默认不打印背景,深色主题打印本来就是白纸浅字)。 落地条款:非受管路径,Clause-② no,不欠 L2,由区线程落地。三项都不需要新 head;收口后告诉我,我核正文和读数。 |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pNoRjsgMJKr5utN33 Delta for L1 · area o1-E · 2026-11-16T18:22Z Head-sha: 98f2943 (unchanged; no commit this round)
|
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn 席位核对 · PR #34422 · L1-b · delta · 2026-11-16T18:27ZHead-sha: 结论:delta REWORK(1 项,只需一个卡号,不动 head)。R1–R3 已关闭。
R4 · 新出现的遗留缺去处。 正文 Acceptance notes 新加了一句:"Still present in both builds and not changed here: with background graphics on, the CI(本 head): 47 success、15 skipped,无失败,没有在跑的检查。 落地条款不变:非受管路径,Clause-② no,不欠 L2,由区线程落地。R4 补上后告诉我,我只核这一句。 |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5mww9UksbwbjvM4aYn 席位核对 · PR #34422 · L1-b · delta · 2026-11-16T18:29ZHead-sha: 结论:delta ACCEPT。 R1–R4 全部关闭。
落地条款不变:非受管路径,Clause-② no,不欠 L2,由区线程落地。本 head 的 CI 上一轮读数是 47 success、15 skipped,无失败。 |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pNoRjsgMJKr5utN33 CI note · area o1-E · 2026-11-16T18:51Z Head 050e7fd (main merged into 98f2943 by update-branch; no PR file changed). |
|
repo:objectstack#1 · os-project-manager · session_01FEkQ5pNoRjsgMJKr5utN33 Land · area o1-E · 2026-11-16T19:06Z
State: ready for review and auto-merge enabled. |
Requested by Leehom · project thread
Part of #34228
Ruling-ref: 6922479414 (item 3 of #34228: the maintainer chose C 「规则不动,拆开报价单模板」;
avoidBreakInsidekeeps its published meaning, the quote template is split instead)Clause-②: no
Metadata-protocol: none
This PR builds items 1, 2 and 4 of the card. Item 3 (the blank half page under
avoidBreakInside) was measured (below) and ruled C by the maintainer (record 6922479414):avoidBreakInsidekeeps its published meaning, and a print page that may break between sections authors onerecord:detailsblock per section. Where the rest of that ruling goes: the reply to the reporter is on #34228; the HotCRM quote template split is hotcrm#2553; the one-sentence guidance incontent/docs/ui/print-pages.mdxandskills/objectstack-ui/rules/pages.mdis the separate text PR #34436 (Part of #34228, Tier H, handed to the maintainer by the seat); a longrecord:line_itemstable moving whole to the next sheet is #34427, outside this ruling.维护者速读
format: 'short'的日期按语言自己的顺序显示(2026年11月15日);打印时明细表收进纸宽;纸面为白底,查找字段和下拉选项印成普通文字。11月 15, '26,五列明细表超出卡片边框,背景发灰,状态印成彩色胶囊。short日期都会变成该语言自己的写法,英语(美式)不变;打印规则只在@media print且限定在打印页内。回滚即还原本 PR。ui/packages/core/src/utils/date-display.ts(short分支的语言顺序判断)、ui/packages/components/src/renderers/layout/page-print.ts(新增的三组打印规则)、ui/packages/fields/src/index.tsx(下拉徽章上的打印钩子属性)。pnpm --dir ui exec vitest run packages/core/src/utils/__tests__/date-display.shortLocaleOrder-34228.test.ts,预期全部通过,zh-CN一行断言2026年11月15日。What changes
Item 1, dates. The mechanism the dispatch named was measured first and does not hold. Headless Chromium does run with
en-USas its default (navigator.language=en-US, Chromium 153.0.8010.12), but every date renderer passes an explicit tag (useDisplayLocale()never answersundefined), and in that same ChromiumtoLocaleDateString('zh-CN', { month: 'short' })answers11月. The record page and the list grid draw a date through the sameDateCellRenderer. The shape11月 15, '26has one producer in the tree:formatDate's'short'face. That face put a localized month token into a fixed English layout (Nov 15, '26). The quote's date fields are authoredformat: 'short'(the HotCRM quote object declares it onquote_dateandexpiration_dateso that they always show the year). So the same face showed on screen and on paper.The fix is at that producer. The compact layout is kept only where it is the locale's own order (month → day → year, asked of
Intl.DateTimeFormat#formatToParts, cached per tag). Every other locale gets its own date with the year, which is the default face with the year shown:zh-CN/ja-JP2026年11月15日,ko-KR2026년 11월 15일,de-DE15. Nov. 2026,en-GB15 Nov 2026.en/en-USstayNov 15, '26, byte for byte. The change reaches every reader offormatDate(v, 'short', { locale })(date cells, dataset measures), on screen and on paper alike. There is no print-only formatter.Item 2, tables fit the sheet. On a print page, every data table except the running header/footer table gets
width: 100%, and its cells drop the on-screenmin-widthandwhite-space: nowrap(!important, because the grid sets the minimum width inline). The columns then shrink and wrap to the box. The overflow was what drew the stray vertical rule: the wrapper's right border ran through the last column.Item 4, document face. On paper the page and its ancestors print on
#fff. Links print in the surrounding colour with no underline; a lookup's reference is a link. A select value's badge prints as its label: no fill, transparent border, no padding, no radius, with!importantso that it also beats a hex option colour's inline style. To give the stylesheet a stable hook,SelectCellRenderer's badge carries a new inertdata-select-badgeattribute. Nothing reads it on screen. Every new rule sits inside@media printand names[data-print-page], and a test pins that for every rule of the sheet. The optional page-level switch from the card is not built (it would add a spec key).Tests
ui/packages/core/src/utils/__tests__/date-display.shortLocaleOrder-34228.test.ts: six non-month-first locales get their own face;en/en-UScontrols keepNov 15, '26; theshortface equals the default face withalwaysShowYear.ui/packages/plugin-detail/src/__tests__/recordDetailsPrintFace-34228.test.tsx: a realrecord:detailson a real print page (SchemaRenderer→PageRenderer) underLocalizationProviderzh-CNdraws2026年11月15日(control:endrawsNov 15, '26). A rule of the stylesheet the page actually mounts matches the real select badge and the real lookup anchor, with the plain-text declarations.ui/packages/components/src/__tests__/page-print-paper-34228.test.tsx: the rule text; every rule is scoped to the print page; the fit selectors match a data table and its cells on a real print page and never the running-region table or its cells.date-formatter-residue-4272.test.tspinned8月 15, '26/Okt 15, '26, the face this card retires. Its expected values are now2026年8月15日/15. Okt. 2026, and theenmust-not-change pins are untouched. One assertion inpage-print-stylesheet-11958.test.tsxwas a substring (data-print-running]) {) that the new fit rule also contains. It now spells the running-region rule it meant (:has(> table[data-print-running]) {).Suite readings
pnpm --dir ui exec vitest run --maxWorkers=2 packages/core/ packages/fields/ packages/components/ packages/plugin-detail/ packages/plugin-form/ondd8fec17:Test Files 1639 passed | 3 skipped (1642),Tests 19666 passed | 77 skipped (19743), lockVERDICT command-exit 0.dd8fec17(23cdb744) changes two test files only: a module-topimport '@object-ui/react-runtime'thatcheck:test-source-aliasasked for. Their local rerun andtype-checkof@object-ui/core,fields,componentsandplugin-detail: NOT MEASURED, reason: four tries at the shared verify lock found no free turn (exit 99) behind a dogfood build and test run. CI'sType Check UIandTest UIcarry both.23cdb744: 37 of 39 families ran locally and exited 0 (check:test-source-aliasafter the fix above).pnpm check:type-check-debt: NOT MEASURED (exit 3; its closure build got no lock turn).pnpm --dir ui exec vitest run scripts/: not run, CI-owned.Acceptance notes
record:detailsof one section, a 5-columnrecord:line_items, then arecord:detailsof two sections,pricingandterms, 11 short fields) rendered throughSchemaRenderer, the console's compiled Tailwind sheet, Chromium 153page.pdf, A4 portrait with 18/15 mm margins,avoidBreakInside: true, and the blank space read frompdftotext -bbox.break-inside: avoidkeeps a block that fits whole on one sheet. That is exactly what the published text says: "keep each block whole on one sheet when it fits".pricingsection, which is the split the key exists to prevent.break-inside: avoidon each section card ofrecord:details, the block-level rule left on every other block), injected into the same page: 3 lines leaves 4% blank on page 1, withpricingwhole on page 1 andtermswhole on page 2. 6 lines gives 18%, the same as today, becausepricingdoes not fit the space left either.record:detailsblock run across two sheets between sections. The showcase invoice'sinvoiceandamountssections could then print on different sheets. Every block that is notrecord:detailswould be unchanged.avoidBreakInsidedeclares ("on every block"). The maintainer ruled C (record 6922479414): the rule stays, and the quote template is split into onerecord:detailsper section instead. Measured on the split template: page 1 is 4% blank with 3 lines and 18% with 6 (dev report 6923091449 on print (service-print, zh-CN): a printed record page shows dates as "11月 15, '26", lets a wide record:line_items table overflow its card, leaves half of page 1 blank, and prints screen styling (grey page, link colour, badges) #34228).shortface change shows on screen too: azh-CNuser's record page and list cells for aformat: 'short'date now read2026年11月15日. This is the same defect, fixed at its producer.ui/packages/core/src/utils/date-display.tsswapped back to itscfcba539version on head98f29438,date-display.shortLocaleOrder-34228andrecordDetailsPrintFace-34228fail 8 of 13.zh-CN,zhandja-JPexpect2026年11月15日and receive11月 15, '26;ko-KR,de-DEanden-GBfail too; thezh-CNprint page rendersQuote Date 11月 15, '26. Theenanden-UScontrols stay green. With the file restored from HEAD (blobe9d02cc1matches,git diff HEADis empty) both files pass 13/13. Dev report 6925134613 on print (service-print, zh-CN): a printed record page shows dates as "11月 15, '26", lets a wide record:line_items table overflow its card, leaves half of page 1 blank, and prints screen styling (grey page, link colour, badges) #34228.ui/packages/app-shell/src/styles.css,.dark, .dark *getcolor: #000 !importantinside@media print) does this, not the page print stylesheet. Measured on a body field value, A4, headless Chromium withclass="dark"on the root: with background graphics on,cfcba539printed black text on the dark (18,18,18) canvas, which cannot be read, and98f29438prints it on white; with background graphics off, both builds print black on white. Still present in both builds and not changed here: with background graphics on, the@pagemargin band prints dark (18,18,18) in dark theme (measured in a scratch harness only); filed as print: in the dark theme with background graphics on, the @page margin band prints dark (color-scheme: dark canvas has no print colour) #34446.Discount %prints as two lines in the 5-column table.Verification
Chromium 153.0.8010.12 (
/opt/pw-browsers/chromium), the real print-page DOM of the item-3 harness (zh-CN, 6 lines, prices¥1,234,567.89, totals¥12,345,678.90), the console's compiled stylesheet, inside a grey app shell. Geometry is read underemulateMedia('print')at the A4 printable width (680 px, transitions off); the PDF is read withpdftoppmandpdftotext.Before (main cfcba53) / after
record:line_itemstable vs its 630 px boxTotalrgb(237, 237, 242)/rgb(246, 246, 249)rgb(255, 255, 255)/rgb(255, 255, 255)北京黑猫科技有限公司rgb(0, 123, 255)rgb(2, 8, 23)= the page's text colour已批准badgergb(2, 8, 23)11月 15, '26,12月 15, '262026年11月15日,2026年12月15日Generated by Claude Code